package com.example.yls.demob;

import android.content.Context;
import android.graphics.Color;
import android.support.v7.widget.AppCompatButton;
import android.util.AttributeSet;

/**
 * Created by yls on 2019/5/8.
 */

public class MyButton extends AppCompatButton {
    private MyColor myColor;

    public MyButton(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyColor getMyColor() {
        return myColor;
    }

    public void setMyColor(MyColor myColor) {
        this.myColor = myColor;
        this.setBackgroundColor(Color.argb(255, myColor.red, myColor.green, myColor.blue));
    }
}
